package io.kiki.sba.registry.common.model.metaserver.cluster;

import java.io.Serializable;
import java.util.Collections;
import java.util.List;


public class VersionedList<T> implements Cluster<T>, Serializable {

    public static final VersionedList EMPTY = new VersionedList(Collections.emptyList(), -1L);
    private final List<T> list;
    private final long epoch;

    public VersionedList(List<T> list, long epoch) {
        this.epoch = epoch;
        this.list = list;
    }

    @Override
    public long getEpoch() {
        return epoch;
    }

    @Override
    public List<T> getList() {
        return list;
    }
}
